package com.example.demo.Service.Impl;

import com.example.demo.Bean.AllSeckill;
import com.example.demo.Bean.IndexProduct;
import com.example.demo.Mapper.IndexProductMapper;
import com.example.demo.Service.IndexProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@CacheConfig(cacheNames = "book")
public class IndexProductServiceImpl implements IndexProductService {
    @Autowired
    private IndexProductMapper indexProductMapper;

    @Override
    @Cacheable
    public List<IndexProduct> QueryAllIndexProduct() {
        return indexProductMapper.QueryAllIndexProduct();
    }

    @Override
    public List<AllSeckill> getAllSeckill(String nowtime) {
        return indexProductMapper.getAllSeckill(nowtime);
    }
}
